package it.low.game.client.gui.graphics;

import it.low.game.client.GameClient;
import it.low.game.client.GameSession;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;

import javax.swing.ImageIcon;

public class MapBackgroundTile extends Rectangle {

	private Point absPoint = null;
	private Image image = null;
	
	public MapBackgroundTile(Point absPoint, ImageIcon imageIcon){
		this.absPoint = absPoint;
		this.setLocation(absPoint);
		this.setSize(imageIcon.getIconWidth(), imageIcon.getIconHeight());
		this.image = imageIcon.getImage();
	}
		
	public void draw(Graphics g){
		GameSession gameSession = GameClient.getGameSession();
		g.drawImage(image,absPoint.x + gameSession.getOffset().x, absPoint.y + gameSession.getOffset().y,null);
	}
}
